package day8;

import javax.lang.model.element.NestingKind;

public class D8_2 {
    public static void main(String[] args) {
        Cat cat=new Cat();
        cat.eat();
        cat.catchmouse();
        Dog dog=new Dog();
        dog.eat();
        dog.lookHome();
    }
}
class Cat{
    String color;
    int legnum;
    public void eat(){
        System.out.println("猫吃鱼");
    }
    public void catchmouse(){
        System.out.println("猫捉老鼠");
    }
}
class Dog extends Cat{
    public void eat(){
        System.out.println("狗吃骨头");
    }
    public void lookHome(){
        System.out.println("狗看家");
    }
}